<!DOCTYPE html>
<html>
    <head>
        <title>综合练习  </title>
		<meta charset="utf-8" />
    </head>
    <body>

    </body>
    <script>
        var str = "no zuo no die";
        var arr = str.split(" ");
        var arr2 = [];
        console.log(arr);
        arr.forEach(function(el,index,arr1){
            var firstChar = el[0].toUpperCase();
            var newStr = firstChar + el.slice(1);
            arr2.push(newStr);
        })
        console.log(arr2.join(" "));
    </script>
</html>